//! @Author: DengLibin 榆霖
//! @Date:  2022-07-01 12:31:11
//! @Des&cription: 



use dao::mysql_conn_pool;
use dao::article_dao;
use dao::entity::article::Article;

/// @Author: DengLibin 榆霖
/// @Date:  2022-07-01 13:47:33
/// @Description: 测试添加
#[test]
pub fn test_insert(){

    let pool = mysql_conn_pool::create_conn_pool().unwrap();
    let a = Article{
        id: 1,
        parent_id: 0,
        create_time: common::date::get_chrono_local_now_time_str(),
        title: String::from("测试1"),
        content: String::from("内容。。。。"),
    };
    let r = article_dao::insert(&a, &pool);
    match r{
        Ok(b) => {println!("添加结果:{}", b)},
        Err(e) => {println!("{}", e)}
    }
}